package com.authine.cloudpivot.common.extension.client;

import com.alibaba.cola.dto.SingleResponse;
import com.authine.cloudpivot.common.extension.client.dto.AttachmentDTO;
import com.authine.cloudpivot.common.extension.client.dto.AttachmentRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 文件服务扩展点默认扩展API
 * <p>
 * 请勿修改任何内容
 */
@FeignClient(name = "app-commonserviceextension", path = "/file/v1")
public interface FileExtensionFeignServiceI {

    @PostMapping(value = "/upload")
    SingleResponse<String> uploadFile(@RequestBody AttachmentDTO attachmentRes);

    @GetMapping(value = "/download")
    SingleResponse<AttachmentRes> downloadFile(@RequestParam(name = "refId") String refId);

    @GetMapping(value = "/delete")
    SingleResponse<Boolean> deleteByRefId(@RequestParam(name = "refId") String refId);

    @GetMapping(value = "/remove_objects")
    SingleResponse<Boolean> removeObjects(@RequestParam(name = "bucketName") String bucketName, @RequestParam(name = "objectName") String objectName);

}
